package com.zd.springsecuritydemo.exception;

import lombok.Getter;

@Getter
public class BusinessException extends RuntimeException {
    private Integer errCode;

    public BusinessException setErrCode(Integer errCode) {
        this.errCode = errCode;
        return this;
    }

    public BusinessException(String message, Integer errCode) {
        super(message);
        this.errCode = 500;
        this.errCode = errCode;
    }

    public BusinessException() {
        this.errCode = 500;
    }

    public BusinessException(String message) {
        super(message);
        this.errCode = 500;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.errCode = 500;
    }

    public BusinessException(Throwable cause) {
        super(cause);
        this.errCode = 500;
    }
}
